/*package com.nuanshui.heatedloan.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.ImportResource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Controller;
import org.springframework.validation.Validator;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
import org.springframework.web.servlet.view.velocity.VelocityViewResolver;

@EnableWebMvc
@Configuration
@ComponentScan(basePackages= {"com.nuanshui"},
	includeFilters = {@Filter(type = FilterType.ANNOTATION, value=Controller.class)} //自动扫描且只扫描@Controller
)
@ImportResource({"classpath:spring-mvc.xml"})
public class WebMvcConfig extends WebMvcConfigurerAdapter{
	
	*//**
	 * 配置试图解析器
	 * @author Gonzo
	 * @date 2016年12月28日下午8:10:29
	 * @return
	 * @since 1.0.0
	 *//*
	@Bean
	public ViewResolver viewResolver(){
		VelocityViewResolver VelocityViewResolver = new VelocityViewResolver();
		VelocityViewResolver.setSuffix(".html"); // 后缀 
		VelocityViewResolver.setOrder(0); //-第一个匹配的是freemarker的视图解析器，如果匹配不成功，则自动选择order=1的其他解析器
		VelocityViewResolver.setContentType("text/html;charset=UTF-8");
		
		return VelocityViewResolver;
	}
	
	*//**
	 * 配置 Velocity 
	 * @author Gonzo
	 * @date 2016年12月28日下午8:50:33
	 * @return
	 * @since 1.0.0
	 *//*
	@Bean
	public VelocityConfigurer velocityConfigurer(){
		VelocityConfigurer velocityConfigurer = new VelocityConfigurer();
		velocityConfigurer.setResourceLoaderPath("/WEB-INF/");
		velocityConfigurer.setConfigLocation(new ClassPathResource("velocity.properties"));
		return velocityConfigurer;
	}
	
	
	@Override
	public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
		configurer.enable(); //将无法mapping到Controller的path交给default servlet handler处理
	}
	
	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		super.addResourceHandlers(registry);
		registry.addResourceHandler("/static/");
	}
	
	*//**
	 * 校验？
	 *//*
	@Override
	public Validator getValidator() {
		return new LocalValidatorFactoryBean();
	}
	
}
*/